#!/usr/bin/env bash

:<<!EOF!
Autuor : zhaoshun
Time   : 2017/12/20 17:58
Email  : tmby1314@163.com
!EOF!

if [ -d $1 ];then
    find $1 -name "*.c" -o -name "*.h" | xargs grep "$2" -R -l
else
    find . -name "*.c" -o -name "*.h" | xargs grep "$1" -R -l
fi